## Hamel and Bauer, PAG
## Create Figure 1

## Loading package
library(tidyverse)

## Loading data
figures.wide<-read.csv("figure1.csv")

## Panel A
fav = ggplot(figures.wide, aes(x = factor(Gender), 
                         y = fav,
                         ymin = fav - (fav_se*1.96),
                         ymax = fav + (fav_se*1.96),
                         color = factor(Funding))) +  
  geom_pointrange(size =0.5, position = position_dodge(width =.5)) + 
  scale_color_brewer(palette= "Set1", labels=c("Hospitals", "Military")) +
  labs(y = "Favorability", x = "") +
  theme_bw() +
  theme(legend.position = "top",
        legend.title = element_blank()) 

## Panel B
vote = ggplot(figures.wide, aes(x = factor(Gender), 
                               y = vote,
                               ymin = vote - (vote_se*1.96),
                               ymax = vote + (vote_se*1.96),
                               color = factor(Funding))) +  
  geom_pointrange(size =0.5, position = position_dodge(width =.5)) + 
  scale_color_brewer(palette= "Set1", labels=c("Hospitals", "Military")) +
  labs(y = "Vote Support", x = "")+
  theme_bw() +
  theme(legend.position = "top",
        legend.title = element_blank()) 
